<HTML><HEAD><TITLE>current_stream(?Stream)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Stream I/O</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>current_stream(?Stream)</H1>
Succeeds if Stream is a currently open stream.


<DL>
<DT><EM>Stream</EM></DT>
<DD>Atom, integer or variable.
</DD>
</DL>
<H2>Description</H2>
   Used to test whether a given identifier denotes an open stream,
   or enumerates all currently open streams on backtracking.

<P>
   When called with a variable argument, only the physical stream
   numbers are returned, not the symbolic aliases.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>current_stream(+) is semidet
<LI>current_stream(-) is nondet
</UL>
<H3>Fail Conditions</H3>
Fails if Stream is instantiated but does not denote an open stream.
<H3>Exceptions</H3>
<DL>
<DT><EM>(5) type error </EM>
<DD>Name is instantiated, but not to an atom or integer.
</DL>
<H2>Examples</H2>
<PRE>
Success:
    [eclipse 1]: current_stream(S).
    S = 0     More? (;) 
    S = 1     More? (;) 
    S = 2     More? (;) 
    S = 3     More? (;) 
    S = 4     More? (;) 
    S = 5     More? (;) 
    no (more) solution.

    [eclipse 2]: current_stream(output).
    yes.

    [eclipse 3]: current_stream(junk).
    no (more) solution.



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/iostream/open-3.html">open / 3</A>, <A HREF="../../kernel/iostream/open-4.html">open / 4</A>, <A HREF="../../kernel/iostream/get_stream_info-3.html">get_stream_info / 3</A>, <A HREF="../../kernel/iostream/get_stream-2.html">get_stream / 2</A>
</BODY></HTML>
